package fm.dongman.modellib.model;

import android.os.Parcel;
import android.os.Parcelable;

import fm.dongman.animefm.contractlib.IModel;

/**
 * 评论模型
 * Created by Admin on 2017/9/28.
 */

public class CommentModel implements IModel.ICommentModel {

    public static final String TYPE_ARTICLE = "article";
    public static final String TYPE_MANDAN = "mandan";
    public static final String TYPE_SUBJECT = "subject";
    public static final String VOIE = "vote";

    //用户头像
    private String mAvatarUrl;

    //内容
    private String mContent;

    //创建时间
    private String mCreateTime;

    //时间
    private String mTime;

    //性别
    private String mUserGenDer;

    //用户id
    private String mUserId;

    //用户名
    private String mUserName;

    //用户简介
    private String mSummary;

    //类型
    private String mType;

    //目标id
    private String mTarget;

    //被评论对象的id
    private String mSubjectId;

    //投票数
    private String mVotes;

    //动漫标题
    private String mTitle;

    //id
    private String mId;

    private UserModel mUser;

    public CommentModel() {

    }

    public CommentModel(String mAvatarUrl, String mContent, String mCreateTime, String mTime, String mUserGenDer, String mUserId, String mUserName, String mSummary) {
        this.mAvatarUrl = mAvatarUrl;
        this.mContent = mContent;
        this.mCreateTime = mCreateTime;
        this.mTime = mTime;
        this.mUserGenDer = mUserGenDer;
        this.mUserId = mUserId;
        this.mUserName = mUserName;
        this.mSummary = mSummary;
    }

    public String getAvatarUrl() {
        return mAvatarUrl;
    }

    public void setAvatarUrl(String avatarUrl) {
        mAvatarUrl = avatarUrl;
    }

    public String getContent() {
        return mContent;
    }

    public void setContent(String content) {
        mContent = content;
    }

    public String getCreateTime() {
        return mCreateTime;
    }

    public void setCreateTime(String createTime) {
        mCreateTime = createTime;
    }

    public String getTime() {
        return mTime;
    }

    public void setTime(String time) {
        mTime = time;
    }

    public String getUserGenDer() {
        return mUserGenDer;
    }

    public void setUserGenDer(String userGenDer) {
        mUserGenDer = userGenDer;
    }

    public String getUserId() {
        return mUserId;
    }

    public void setUserId(String userId) {
        mUserId = userId;
    }

    public UserModel getUser() {
        return mUser;
    }

    public void setUser(UserModel user) {
        mUser = user;
    }

    public String getId() {
        return mId;
    }

    public void setId(String id) {
        mId = id;
    }

    public String getType() {
        return mType;
    }

    public void setType(String type) {
        mType = type;
    }

    public String getUserName() {
        return mUserName;
    }

    public String getTarget() {
        return mTarget;
    }

    public void setTarget(String target) {
        mTarget = target;
    }

    public void setUserName(String userName) {
        mUserName = userName;
    }

    public String getSummary() {
        return mSummary;
    }

    public void setSummary(String summary) {
        mSummary = summary;
    }

    public String getSubjectId() {
        return mSubjectId;
    }

    public void setSubjectId(String subjectId) {
        mSubjectId = subjectId;
    }

    public String getTitle() {
        return mTitle;
    }

    public String getVotes() {
        return mVotes;
    }

    public void setVotes(String votes) {
        mVotes = votes;
    }

    public void setTitle(String title) {
        mTitle = title;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(mAvatarUrl);
        dest.writeString(mContent);
        dest.writeString(mCreateTime);
        dest.writeString(mTime);
        dest.writeString(mUserGenDer);
        dest.writeString(mUserId);
        dest.writeString(mUserName);
        dest.writeString(mSummary);
        dest.writeString(mType);
    }

    public static Parcelable.Creator<CommentModel> CREATOR = new Creator<CommentModel>() {
        @Override
        public CommentModel createFromParcel(Parcel source) {
            CommentModel model = new CommentModel();
            model.setAvatarUrl(source.readString());
            model.setContent(source.readString());
            model.setCreateTime(source.readString());
            model.setTime(source.readString());
            model.setUserGenDer(source.readString());
            model.setUserId(source.readString());
            model.setUserName(source.readString());
            model.setSummary(source.readString());
            model.setType(source.readString());
            return model;
        }

        @Override
        public CommentModel[] newArray(int size) {
            return new CommentModel[size];
        }
    };
}
